package com.stockz.equity.indicator.vsa.pattern;

import java.util.List;

import org.springframework.stereotype.Component;

import com.stockz.equity.indicator.vsa.VsaBar;
import com.stockz.equity.indicator.vsa.property.Volume;
import com.stockz.equity.model.Bar;

@Component
public class Temp extends VsaPattern {

	public Temp() {
		super("P", "Temp", VsaPatternType.Undefined);
	}

	@SuppressWarnings("unused")
	@Override
	public void analyze(List<Bar> barList, List<VsaBar> vsaBarList, int index) {
		if(index == 0 || index >= barList.size()-1){
			return;
		}
		VsaBar vsaBar = vsaBarList.get(index);
		Bar current = barList.get(index);
		Bar next = barList.get(index-1);
		Bar previous = barList.get(index+1);
		/*if(!Close.Low.equals(vsaBar.getClose())
				&& !Region.OverBaught.equals(vsaBar.getRegion())
				&& Spread.UltraNarrow.equals(vsaBar.getSpread())
				&& Type.Down.equals(vsaBar.getType())
				&& Volume.Average.equals(vsaBar.getVolume())
				&& Type.Up.equals(vsaBar.getNextType())
				&& !Volume.Low.equals(vsaBar.getVolume())){
			vsaBar.getVsaPatternList().add(this);
		}*/
		
		
		if(current.getClose() < previous.getClose()
				&& current.getAveragePrice() > previous.getAveragePrice()
				&& Volume.Low.equals(vsaBar.getVolume())){
			vsaBar.getVsaPatternList().add(this);
		}
		
	}

}
